package setprite;

import java.util.TreeSet;

public class Set04 {
    public static void main(String[] args) {
        //按照年龄进行排序，年龄一致，按姓名首字母排序
        //姓名和年龄一致，认为是同一个学生，不存
        TreeSet<Student> treeSet=new TreeSet<>();
        Student student=new Student("bb",55);
        Student student1=new Student("ee",75);
        Student student2=new Student("mm",66);
        Student student3=new Student("gg",36);
        treeSet.add(student);
        treeSet.add(student1);
        treeSet.add(student2);
        treeSet.add(student3);
        System.out.println(treeSet);

    }
}
